<template>
  <div class="hmttNavBar">
    <van-nav-bar @click-right="RightClick" @click-left="$router.push(path)">
      <template #left>
        <div class="left" v-if="icon">
          <i class="iconfont" v-html="icon">{{ icon }}</i>
        </div>
      </template>
      <template #title>
        <div class="title">{{ title }}</div>
      </template>
      <template #right>
        <div class="right">
          {{ right }}
        </div>
      </template>
    </van-nav-bar>
  </div>
</template>

<script>
export default {
  name: 'hmttNavBar',
  props: ['icon', 'title', 'right', 'path'],
  methods: {
    RightClick () {
      alert('保存')
    }
  }
}
</script>

<style lang="less" scoped>
.hmttNavBar {
  width: 100%;
  .van-nav-bar {
    color: #ffffff;
    background-color: #3296fa;
  }

  ::v-deep .van-nav-bar__left,
  ::v-deep .van-nav-bar__right {
    padding: 0;
  }
  .left {
    margin-left: 15px;
  }
  .title {
    font-size: 18px;
    font-family: PingFangSC, PingFangSC-Semibold;
    font-weight: 600;
    text-align: left;
    color: #ffffff;
    line-height: 25px;
    letter-spacing: 0px;
  }
  .right {
    font-size: 14px;
    font-family: PingFangSC, PingFangSC-Semibold;
    font-weight: 400;
    color: #ffffff;
    text-align: right;
    line-height: 24px;
    letter-spacing: 0px;
    margin-right: 15px;
  }
}
</style>
